import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            int n = Integer.parseInt(in.nextLine());
            int flag = 0;
            String ret = "";
            String[] s = new String[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.nextLine();
            }
            for (int i = 0; i < n; i++) {
                String ss = s[i];
                for (int j = 0; j < ss.length(); j++) {
                    if (ss.charAt(j) == ' ' || ss.charAt(j) == ',') {
                        flag = 1;
                        ss = "\"" + ss + "\"";
                        break;
                    }
                }
                s[i] = ss;
            }
            for (int i = 0; i < n - 1; i ++) {
                ret = ret + s[i] + ", ";
            }
            ret += s[n - 1];
            System.out.println(ret);
        }
    }
}
